// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Consumer Surveys API Version v2
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href=''>Consumer Surveys API</a>
 *      <tr><th>API Version<td>v2
 *      <tr><th>API Rev<td>20161101 (670)
 *      <tr><th>API Docs
 *          <td><a href=''>
 *              </a>
 *      <tr><th>Discovery Name<td>consumersurveys
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Consumer Surveys API can be found at
 * <a href=''></a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.ConsumerSurveys.v2
{
    /// <summary>The ConsumerSurveys Service.</summary>
    public class ConsumerSurveysService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v2";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public ConsumerSurveysService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public ConsumerSurveysService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            mobileapppanels = new MobileapppanelsResource(this);
            results = new ResultsResource(this);
            surveys = new SurveysResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "consumersurveys"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://www.googleapis.com/consumersurveys/v2/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return "consumersurveys/v2/"; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Consumer Surveys API.</summary>
        public class Scope
        {
            /// <summary>View and edit your surveys and results</summary>
            public static string Consumersurveys = "https://www.googleapis.com/auth/consumersurveys";

            /// <summary>View the results for your surveys</summary>
            public static string ConsumersurveysReadonly = "https://www.googleapis.com/auth/consumersurveys.readonly";

            /// <summary>View your email address</summary>
            public static string UserinfoEmail = "https://www.googleapis.com/auth/userinfo.email";

        }



        private readonly MobileapppanelsResource mobileapppanels;

        /// <summary>Gets the Mobileapppanels resource.</summary>
        public virtual MobileapppanelsResource Mobileapppanels
        {
            get { return mobileapppanels; }
        }

        private readonly ResultsResource results;

        /// <summary>Gets the Results resource.</summary>
        public virtual ResultsResource Results
        {
            get { return results; }
        }

        private readonly SurveysResource surveys;

        /// <summary>Gets the Surveys resource.</summary>
        public virtual SurveysResource Surveys
        {
            get { return surveys; }
        }
    }

    ///<summary>A base abstract class for ConsumerSurveys requests.</summary>
    public abstract class ConsumerSurveysBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new ConsumerSurveysBaseServiceRequest instance.</summary>
        protected ConsumerSurveysBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>Data format for the response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for the response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
        }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>IP address of the site where the request originates. Use this if you want to enforce per-user
        /// limits.</summary>
        [Google.Apis.Util.RequestParameterAttribute("userIp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UserIp { get; set; }

        /// <summary>Initializes ConsumerSurveys parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "userIp", new Google.Apis.Discovery.Parameter
                {
                    Name = "userIp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "mobileapppanels" collection of methods.</summary>
    public class MobileapppanelsResource
    {
        private const string Resource = "mobileapppanels";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public MobileapppanelsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Retrieves a MobileAppPanel that is available to the authenticated user.</summary>
        /// <param name="panelId">External URL ID for the panel.</param>
        public virtual GetRequest Get(string panelId)
        {
            return new GetRequest(service, panelId);
        }

        /// <summary>Retrieves a MobileAppPanel that is available to the authenticated user.</summary>
        public class GetRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanel>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string panelId)
                : base(service)
            {
                PanelId = panelId;
                InitParameters();
            }


            /// <summary>External URL ID for the panel.</summary>
            [Google.Apis.Util.RequestParameterAttribute("panelId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string PanelId { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "mobileAppPanels/{panelId}"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "panelId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "panelId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Lists the MobileAppPanels available to the authenticated user.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Lists the MobileAppPanels available to the authenticated user.</summary>
        public class ListRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanelsListResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }



            [Google.Apis.Util.RequestParameterAttribute("maxResults", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> MaxResults { get; set; }


            [Google.Apis.Util.RequestParameterAttribute("startIndex", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> StartIndex { get; set; }


            [Google.Apis.Util.RequestParameterAttribute("token", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Token { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "mobileAppPanels"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "maxResults", new Google.Apis.Discovery.Parameter
                    {
                        Name = "maxResults",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "startIndex", new Google.Apis.Discovery.Parameter
                    {
                        Name = "startIndex",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "token", new Google.Apis.Discovery.Parameter
                    {
                        Name = "token",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Updates a MobileAppPanel. Currently the only property that can be updated is the owners
        /// property.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="panelId">External URL ID for the panel.</param>
        public virtual UpdateRequest Update(Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanel body, string panelId)
        {
            return new UpdateRequest(service, body, panelId);
        }

        /// <summary>Updates a MobileAppPanel. Currently the only property that can be updated is the owners
        /// property.</summary>
        public class UpdateRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanel>
        {
            /// <summary>Constructs a new Update request.</summary>
            public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanel body, string panelId)
                : base(service)
            {
                PanelId = panelId;
                Body = body;
                InitParameters();
            }


            /// <summary>External URL ID for the panel.</summary>
            [Google.Apis.Util.RequestParameterAttribute("panelId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string PanelId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.ConsumerSurveys.v2.Data.MobileAppPanel Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "update"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "PUT"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "mobileAppPanels/{panelId}"; }
            }

            /// <summary>Initializes Update parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "panelId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "panelId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "results" collection of methods.</summary>
    public class ResultsResource
    {
        private const string Resource = "results";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ResultsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Retrieves any survey results that have been produced so far. Results are formatted as an Excel
        /// file. You must add "?alt=media" to the URL as an argument to get results.</summary>
        /// <param name="surveyUrlId">External URL ID for the survey.</param>
        public virtual GetRequest Get(string surveyUrlId)
        {
            return new GetRequest(service, surveyUrlId);
        }

        /// <summary>Retrieves any survey results that have been produced so far. Results are formatted as an Excel
        /// file. You must add "?alt=media" to the URL as an argument to get results.</summary>
        public class GetRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.SurveyResults>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string surveyUrlId)
                : base(service)
            {
                SurveyUrlId = surveyUrlId;
                MediaDownloader = new Google.Apis.Download.MediaDownloader(service);
                InitParameters();
            }


            /// <summary>External URL ID for the survey.</summary>
            [Google.Apis.Util.RequestParameterAttribute("surveyUrlId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string SurveyUrlId { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{surveyUrlId}/results"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "surveyUrlId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "surveyUrlId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

            /// <summary>Gets the media downloader.</summary>
            public Google.Apis.Download.IMediaDownloader MediaDownloader { get; private set; }

            /// <summary>Synchronously download the media into the given stream.</summary>
            public virtual void Download(System.IO.Stream stream)
            {
                MediaDownloader.Download(this.GenerateRequestUri(), stream);
            }

            /// <summary>Asynchronously download the media into the given stream.</summary>
            public virtual System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress> DownloadAsync(System.IO.Stream stream)
            {
                return MediaDownloader.DownloadAsync(this.GenerateRequestUri(), stream);
            }

            /// <summary>Asynchronously download the media into the given stream.</summary>
            public virtual System.Threading.Tasks.Task<Google.Apis.Download.IDownloadProgress> DownloadAsync(System.IO.Stream stream,
                System.Threading.CancellationToken cancellationToken)
            {
                return MediaDownloader.DownloadAsync(this.GenerateRequestUri(), stream, cancellationToken);
            }

        }
    }

    /// <summary>The "surveys" collection of methods.</summary>
    public class SurveysResource
    {
        private const string Resource = "surveys";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public SurveysResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Removes a survey from view in all user GET requests.</summary>
        /// <param name="surveyUrlId">External URL ID for the survey.</param>
        public virtual DeleteRequest Delete(string surveyUrlId)
        {
            return new DeleteRequest(service, surveyUrlId);
        }

        /// <summary>Removes a survey from view in all user GET requests.</summary>
        public class DeleteRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.SurveysDeleteResponse>
        {
            /// <summary>Constructs a new Delete request.</summary>
            public DeleteRequest(Google.Apis.Services.IClientService service, string surveyUrlId)
                : base(service)
            {
                SurveyUrlId = surveyUrlId;
                InitParameters();
            }


            /// <summary>External URL ID for the survey.</summary>
            [Google.Apis.Util.RequestParameterAttribute("surveyUrlId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string SurveyUrlId { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "delete"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "DELETE"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{surveyUrlId}"; }
            }

            /// <summary>Initializes Delete parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "surveyUrlId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "surveyUrlId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Retrieves information about the specified survey.</summary>
        /// <param name="surveyUrlId">External URL ID for the survey.</param>
        public virtual GetRequest Get(string surveyUrlId)
        {
            return new GetRequest(service, surveyUrlId);
        }

        /// <summary>Retrieves information about the specified survey.</summary>
        public class GetRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.Survey>
        {
            /// <summary>Constructs a new Get request.</summary>
            public GetRequest(Google.Apis.Services.IClientService service, string surveyUrlId)
                : base(service)
            {
                SurveyUrlId = surveyUrlId;
                InitParameters();
            }


            /// <summary>External URL ID for the survey.</summary>
            [Google.Apis.Util.RequestParameterAttribute("surveyUrlId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string SurveyUrlId { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "get"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{surveyUrlId}"; }
            }

            /// <summary>Initializes Get parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "surveyUrlId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "surveyUrlId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Creates a survey.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual InsertRequest Insert(Google.Apis.ConsumerSurveys.v2.Data.Survey body)
        {
            return new InsertRequest(service, body);
        }

        /// <summary>Creates a survey.</summary>
        public class InsertRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.Survey>
        {
            /// <summary>Constructs a new Insert request.</summary>
            public InsertRequest(Google.Apis.Services.IClientService service, Google.Apis.ConsumerSurveys.v2.Data.Survey body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }



            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.ConsumerSurveys.v2.Data.Survey Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "insert"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys"; }
            }

            /// <summary>Initializes Insert parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

            }

        }

        /// <summary>Lists the surveys owned by the authenticated user.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Lists the surveys owned by the authenticated user.</summary>
        public class ListRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.SurveysListResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }



            [Google.Apis.Util.RequestParameterAttribute("maxResults", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> MaxResults { get; set; }


            [Google.Apis.Util.RequestParameterAttribute("startIndex", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<long> StartIndex { get; set; }


            [Google.Apis.Util.RequestParameterAttribute("token", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string Token { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "maxResults", new Google.Apis.Discovery.Parameter
                    {
                        Name = "maxResults",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "startIndex", new Google.Apis.Discovery.Parameter
                    {
                        Name = "startIndex",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "token", new Google.Apis.Discovery.Parameter
                    {
                        Name = "token",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Begins running a survey.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="resourceId"></param>
        public virtual StartRequest Start(Google.Apis.ConsumerSurveys.v2.Data.SurveysStartRequest body, string resourceId)
        {
            return new StartRequest(service, body, resourceId);
        }

        /// <summary>Begins running a survey.</summary>
        public class StartRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.SurveysStartResponse>
        {
            /// <summary>Constructs a new Start request.</summary>
            public StartRequest(Google.Apis.Services.IClientService service, Google.Apis.ConsumerSurveys.v2.Data.SurveysStartRequest body, string resourceId)
                : base(service)
            {
                ResourceId = resourceId;
                Body = body;
                InitParameters();
            }



            [Google.Apis.Util.RequestParameterAttribute("resourceId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string ResourceId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.ConsumerSurveys.v2.Data.SurveysStartRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "start"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{resourceId}/start"; }
            }

            /// <summary>Initializes Start parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "resourceId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "resourceId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Stops a running survey.</summary>
        /// <param name="resourceId"></param>
        public virtual StopRequest Stop(string resourceId)
        {
            return new StopRequest(service, resourceId);
        }

        /// <summary>Stops a running survey.</summary>
        public class StopRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.SurveysStopResponse>
        {
            /// <summary>Constructs a new Stop request.</summary>
            public StopRequest(Google.Apis.Services.IClientService service, string resourceId)
                : base(service)
            {
                ResourceId = resourceId;
                InitParameters();
            }



            [Google.Apis.Util.RequestParameterAttribute("resourceId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string ResourceId { get; private set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "stop"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{resourceId}/stop"; }
            }

            /// <summary>Initializes Stop parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "resourceId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "resourceId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }

        /// <summary>Updates a survey. Currently the only property that can be updated is the owners property.</summary>
        /// <param name="body">The body of the request.</param>
        /// <param name="surveyUrlId">External URL ID for the survey.</param>
        public virtual UpdateRequest Update(Google.Apis.ConsumerSurveys.v2.Data.Survey body, string surveyUrlId)
        {
            return new UpdateRequest(service, body, surveyUrlId);
        }

        /// <summary>Updates a survey. Currently the only property that can be updated is the owners property.</summary>
        public class UpdateRequest : ConsumerSurveysBaseServiceRequest<Google.Apis.ConsumerSurveys.v2.Data.Survey>
        {
            /// <summary>Constructs a new Update request.</summary>
            public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.ConsumerSurveys.v2.Data.Survey body, string surveyUrlId)
                : base(service)
            {
                SurveyUrlId = surveyUrlId;
                Body = body;
                InitParameters();
            }


            /// <summary>External URL ID for the survey.</summary>
            [Google.Apis.Util.RequestParameterAttribute("surveyUrlId", Google.Apis.Util.RequestParameterType.Path)]
            public virtual string SurveyUrlId { get; private set; }


            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.ConsumerSurveys.v2.Data.Survey Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "update"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "PUT"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "surveys/{surveyUrlId}"; }
            }

            /// <summary>Initializes Update parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "surveyUrlId", new Google.Apis.Discovery.Parameter
                    {
                        Name = "surveyUrlId",
                        IsRequired = true,
                        ParameterType = "path",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }
}

namespace Google.Apis.ConsumerSurveys.v2.Data
{    

    public class FieldMask : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("fields")]
        public virtual System.Collections.Generic.IList<FieldMask> Fields { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual System.Nullable<int> Id { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class MobileAppPanel : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("country")]
        public virtual string Country { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("isPublicPanel")]
        public virtual System.Nullable<bool> IsPublicPanel { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("language")]
        public virtual string Language { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("mobileAppPanelId")]
        public virtual string MobileAppPanelId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("owners")]
        public virtual System.Collections.Generic.IList<string> Owners { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class MobileAppPanelsListResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("pageInfo")]
        public virtual PageInfo PageInfo { get; set; } 

        /// <summary>Unique request ID used for logging and debugging. Please include in any error reporting or
        /// troubleshooting requests.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>An individual predefined panel of Opinion Rewards mobile users.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resources")]
        public virtual System.Collections.Generic.IList<MobileAppPanel> Resources { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("tokenPagination")]
        public virtual TokenPagination TokenPagination { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class PageInfo : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("resultPerPage")]
        public virtual System.Nullable<int> ResultPerPage { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("startIndex")]
        public virtual System.Nullable<int> StartIndex { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("totalResults")]
        public virtual System.Nullable<int> TotalResults { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ResultsGetRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("resultMask")]
        public virtual ResultsMask ResultMask { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class ResultsMask : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("fields")]
        public virtual System.Collections.Generic.IList<FieldMask> Fields { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("projection")]
        public virtual string Projection { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class Survey : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("audience")]
        public virtual SurveyAudience Audience { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("cost")]
        public virtual SurveyCost Cost { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("customerData")]
        public virtual string CustomerData { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("owners")]
        public virtual System.Collections.Generic.IList<string> Owners { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("questions")]
        public virtual System.Collections.Generic.IList<SurveyQuestion> Questions { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("rejectionReason")]
        public virtual SurveyRejection RejectionReason { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("state")]
        public virtual string State { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("surveyUrlId")]
        public virtual string SurveyUrlId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("title")]
        public virtual string Title { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("wantedResponseCount")]
        public virtual System.Nullable<int> WantedResponseCount { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyAudience : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("ages")]
        public virtual System.Collections.Generic.IList<string> Ages { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("country")]
        public virtual string Country { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("countrySubdivision")]
        public virtual string CountrySubdivision { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("gender")]
        public virtual string Gender { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("languages")]
        public virtual System.Collections.Generic.IList<string> Languages { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("mobileAppPanelId")]
        public virtual string MobileAppPanelId { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("populationSource")]
        public virtual string PopulationSource { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyCost : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("costPerResponseNanos")]
        public virtual System.Nullable<long> CostPerResponseNanos { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("currencyCode")]
        public virtual string CurrencyCode { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("maxCostPerResponseNanos")]
        public virtual System.Nullable<long> MaxCostPerResponseNanos { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("nanos")]
        public virtual System.Nullable<long> Nanos { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyQuestion : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("answerOrder")]
        public virtual string AnswerOrder { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("answers")]
        public virtual System.Collections.Generic.IList<string> Answers { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("hasOther")]
        public virtual System.Nullable<bool> HasOther { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("highValueLabel")]
        public virtual string HighValueLabel { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("images")]
        public virtual System.Collections.Generic.IList<SurveyQuestionImage> Images { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("lastAnswerPositionPinned")]
        public virtual System.Nullable<bool> LastAnswerPositionPinned { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("lowValueLabel")]
        public virtual string LowValueLabel { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("mustPickSuggestion")]
        public virtual System.Nullable<bool> MustPickSuggestion { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("numStars")]
        public virtual string NumStars { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("openTextPlaceholder")]
        public virtual string OpenTextPlaceholder { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("openTextSuggestions")]
        public virtual System.Collections.Generic.IList<string> OpenTextSuggestions { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("question")]
        public virtual string Question { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("sentimentText")]
        public virtual string SentimentText { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("singleLineResponse")]
        public virtual System.Nullable<bool> SingleLineResponse { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("thresholdAnswers")]
        public virtual System.Collections.Generic.IList<string> ThresholdAnswers { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("unitOfMeasurementLabel")]
        public virtual string UnitOfMeasurementLabel { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("videoId")]
        public virtual string VideoId { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyQuestionImage : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("altText")]
        public virtual string AltText { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("data")]
        public virtual string Data { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("url")]
        public virtual string Url { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyRejection : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("explanation")]
        public virtual string Explanation { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveyResults : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("status")]
        public virtual string Status { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("surveyUrlId")]
        public virtual string SurveyUrlId { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveysDeleteResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Unique request ID used for logging and debugging. Please include in any error reporting or
        /// troubleshooting requests.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveysListResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("pageInfo")]
        public virtual PageInfo PageInfo { get; set; } 

        /// <summary>Unique request ID used for logging and debugging. Please include in any error reporting or
        /// troubleshooting requests.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>An individual survey resource.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resources")]
        public virtual System.Collections.Generic.IList<Survey> Resources { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("tokenPagination")]
        public virtual TokenPagination TokenPagination { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveysStartRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Threshold to start a survey automically if the quoted prices is less than or equal to this value.
        /// See Survey.Cost for more details.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("maxCostPerResponseNanos")]
        public virtual System.Nullable<long> MaxCostPerResponseNanos { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveysStartResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Unique request ID used for logging and debugging. Please include in any error reporting or
        /// troubleshooting requests.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>Survey object containing the specification of the started Survey.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual Survey Resource { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class SurveysStopResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Unique request ID used for logging and debugging. Please include in any error reporting or
        /// troubleshooting requests.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>Survey object containing the specification of the stopped Survey.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual Survey Resource { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    public class TokenPagination : Google.Apis.Requests.IDirectResponseSchema
    {
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        [Newtonsoft.Json.JsonPropertyAttribute("previousPageToken")]
        public virtual string PreviousPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
